<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 400px;
            height: 400px;
            /* background: red; */
            position: absolute;
            right: 10px;
            bottom: 0;
            text-align: right;
            /* background-image: url(img/1.1.png); */
            background-size: 200px, 200px;

        }



        .box span {
            color: rgb(23, 1, 1);
            display: block;
            float: right;
            position: absolute;
            top: 0px;
            right: 0px;
            background-color: red;
            width: 20px;
            height: 20px;
            text-align: center;
        }

        .span {
            background-color: red;
        }
    </style>
</head>

<body>
    <div class="box">
        <img src="img/2.2.jpg" style="width: 400px;
        height: 400px;">
        <a href=""><span>X</span></a>
    </div>
    <script>
        var ele = document.querySelector(".box span");
        var box = document.querySelector(".box");
        // console.log(ele);
        ele.onclick = function () {
            // 关闭弹窗
            box.style.display = "none";
            setTimeout(function () {
                box.style.display = "block";
            }, 200);
        }




    </script>
</body>

</html>